<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2023/4/2
  Time: 19:10
  To change this template use File | Settings | File Templates.
--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1 style="text-align: center">${paper.getTitle()}</h1>
<p style="color: gray;font-size: 12px;text-indent: 5px">温馨提示:鼠标停留获取题目详情</p>
<hr>
<input type="button" value="返回" onclick="back()">
<input type="button" value="新建题目" style="margin-left: 20px" onclick="addquestion()">
<input type="button" value="从题库中添加题目" style="margin-left: 20px" onclick="addquestions()">
<form action="http://localhost:8080/ExaminationManagement1_war/Release" method="post" id="form" style="position: fixed;margin-left: 300px">
  <input type="submit" value="发布试卷" id="release">
  开始时间<input type="date" name="startdate">
  <input type="time" name="starttime"><br>
  结束时间<input type="date" name="enddate" style="margin-left: 50px">
  <input type="time" name="endtime">
  <select name="grade" id="grade">
    <option>请选择班级</option>
    <c:forEach items="${teacher.getGrade()}" var="grade">
      <option>${grade}</option>
    </c:forEach><br>
  </select>
</form>
<c:forEach items="${questions}" var="question" varStatus="id">
  <br><br>
  <a title=" ${question.getQuestion()}">题目id: ${question.getId()}</a><br>
  <a href="http://localhost:8080/ExaminationManagement1_war/DeletePaperQuestion?id=${question.getId()}">
    删除
  </a>
  <br><br>
</c:forEach>
<script type="text/javascript">
  function addquestion(){
    window.location="addquestion.jsp"
  }
  function addquestions(){
    window.location="addquestions.jsp"
  }
  function back(){
    window.location="http://localhost:8080/ExaminationManagement1_war/PaperBack"
  }
  var release=document.getElementById("release")
  release.onsubmit=function (){
    var release=document.getElementById("release")
    var index= release.selectedIndex
    if(release.options[index].value=="请选择班级"){
      alert("请选择班级")
    }
  }
</script>
</body>
</html>
